<!DOCTYPE html>
<html>
<head>
    <title>${@Global.getConfig("productName")} 登录</title>
    @include("/include/head.html"){}
    <script type="text/javascript">
        $(document).ready(function() {
            $("#loginForm").validate({
                rules: {
                    validateCode: {remote: "${ctxPath}/servlet/validateCodeServlet"}
                },
                messages: {
                    username: {required: "请填写用户名."},password: {required: "请填写密码."},
                    validateCode: {remote: "验证码不正确.", required: "请填写验证码."}
                },
                errorLabelContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    error.appendTo($("#loginError").parent());
                }
            });
            $(window).resize();
        });
        // 如果在框架或在对话框中，则弹出提示并跳转到首页
        if(self.frameElement && self.frameElement.tagName == "IFRAME" || $('#left').length > 0 || $('.jbox').length > 0){
            alert('未登录或登录超时。请重新登录，谢谢！');
            top.location = "${ctx}";
        }
        $(window).resize(function(){
            $('body').height($(window).height());
            var top = $('body').height() / 2 - $('.form-signin').height() / 2 - 39;
            var left = $('body').width() / 2 - $('.form-signin').width() / 2 - 14;
            $('.form-signin').css({'top':top,'left':left});
            $('.footer').css({'top':top+250,'left':left+30});
        });
    </script>
</head>
<body>
<div class="container-fluid content">
    <!--[if lte IE 6]><br/><div class='alert alert-block' style="text-align:left;padding-bottom:10px;"><a class="close" data-dismiss="alert">x</a><h4>温馨提示：</h4><p>你使用的浏览器版本过低。为了获得更好的浏览体验，我们强烈建议您 <a href="http://browsehappy.com" target="_blank">升级</a> 到最新版本的IE浏览器，或者使用较新版本的 Chrome、Firefox、Safari 等。</p></div><![endif]-->
        @if(has(message)){
        <script>
            toastr.options.positionClass = "toast-top-center";
            toastr.error("${message}");
        </script>
        @}
    <div class="row">
        <div id="content" class="col-sm-12 full">
            <div class="row">
                <div class="login-box">

                    <div class="header">
                        ${@Global.getConfig("productName")}
                    </div>


                    <form id="loginForm" class="form-horizontal login" action="${ctx}/login" method="post">

                        <fieldset class="col-sm-12">
                            <div class="form-group">
                                <div class="controls row">
                                    <div class="input-group col-sm-12">
                                        <input type="text" class="form-control required" name="username" id="username" placeholder="登录名"/>
                                        <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="controls row">
                                    <div class="input-group col-sm-12">
                                        <input type="password" class="form-control required" name="password" id="password" placeholder="密码"/>
                                        <span class="input-group-addon"><i class="fa fa-key"></i></span>
                                    </div>
                                </div>
                            </div>

                                @if(has(isValidateCodeLogin)){
                                <div class="form-group">
                                    <div class="controls row">
                                        <label class="input-label mid" >验证码</label>
                                        <!--<sys:validateCode name="validateCode" inputCssStyle="margin-bottom:0;"/>-->
                                    </div>
                                </div>
                                @}
                            <div class="confirm">
                                <input type="checkbox" name="remember" id="remember"/>
                                <label for="remember">记住我（公共场所慎用）</label>
                            </div>

                            <div class="row">

                                <button type="submit" class="btn btn-lg btn-primary col-xs-12">登 录</button>

                            </div>

                        </fieldset>

                    </form>


                    <div class="clearfix"></div>

                </div>
            </div><!--/row-->

        </div>

    </div><!--/row-->
</div>
</body>
</html>